package com.jxpanda.infrastructure.core.constant;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * 常用的日期常量
 *
 * @author Panda
 */
public class DateTimeConstant {

    /**
     * 时间格式化样式
     */
    public static final String PATTERN_DATETIME = "yyyy-MM-dd HH:mm:ss";
    public static final String PATTERN_DATE = "yyyy-MM-dd";
    public static final String PATTERN_TIME = "HH:mm:ss";
    public static final String PATTERN_DATETIME_COMPACT = "yyyyMMddHHmmss";
    public static final String PATTERN_DATE_COMPACT = "yyyyMMdd";
    public static final String PATTERN_TIME_COMPACT = "HHmmss";

    /**
     * 常用时间字符串
     */
    public static final String STRING_DATE_1970 = "1970-01-01";
    public static final String STRING_DATE_9999 = "9999-12-31";
    public static final String STRING_TIME_BEGIN = "00:00:00";
    public static final String STRING_TIME_END = "23:59:59";
    public static final String STRING_DATETIME_1970 = STRING_DATE_1970 + " " + STRING_TIME_BEGIN;
    public static final String STRING_DATETIME_9999 = STRING_DATE_9999 + " " + STRING_TIME_END;


    /**
     * 常用时间对象
     */
    public static final LocalDate DATE_1970 = LocalDate.of(1970, 1, 1);
    public static final LocalDate DATE_9999 = LocalDate.of(9999, 12, 31);
    public static final LocalTime TIME_BEGIN = LocalTime.of(0, 0, 0);
    public static final LocalTime TIME_END = LocalTime.of(23, 59, 59);
    public static final LocalDateTime DATETIME_1970 = LocalDateTime.of(DATE_1970, TIME_BEGIN);
    public static final LocalDateTime DATETIME_9999 = LocalDateTime.of(DATE_9999, TIME_END);


    /**
     * 【约定】数据库的删除时间
     * 取值为：1970-01-01 00:00:00
     */
    public static final LocalDateTime DELETED_DATETIME = DATETIME_9999;

}